home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / virus / stelth22.zip / VIRCHECK.H < prev    next >
C/C++ Source or Header  |  1992-02-10  |  2KB  |  77 lines

  1. /*
  2. vircheck.h
  3. Stealth Bomber Version 2.2
  4.  
  5. Kevin Dean
  6. Fairview Mall P.O. Box 55074
  7. 1800 Sheppard Avenue East
  8. Willowdale, Ontario
  9. CANADA    M2J 5B9
  10. CompuServe ID: 76336,3114
  11.  
  12. February 10, 1992
  13.  
  14.     This is the interface to the anti-virus system and CRC checks in the
  15. Stealth Bomber package.
  16.  
  17.     This code is public domain.
  18. */
  19.  
  20.  
  21. #include <stdio.h>
  22.  
  23.  
  24. typedef
  25.   unsigned char byte;
  26.  
  27. typedef
  28.   unsigned short word;
  29.  
  30.  
  31. typedef
  32.   unsigned long crc32_t;
  33.  
  34. typedef union
  35.   {
  36.   char searchstr[8];    /* Used by Stealth Bomber package only. */
  37.  
  38.   struct
  39.     {
  40.     crc32_t polynomial;    /* Polynomial for the file. */
  41.     crc32_t crc;    /* Calculated CRC for the file. */
  42.     } x;
  43.   } filecrc;
  44.  
  45.  
  46. extern const filecrc _fcrc[];
  47.  
  48.  
  49. /* Anti-virus validation return codes. */
  50. enum VirTestResult
  51.   {
  52.   STEALTH_OK            = 0x0000,    /* No virus found. */
  53.  
  54.   STEALTH_INTR_ERR      = 0x0001,    /* Interrupts set beyond the program's code space. */
  55.   STEALTH_DOS_MEM_ERR   = 0x0002,    /* DOS memory inconsistent with BIOS memory. */
  56.   STEALTH_DOS_HIJACKED  = 0x0004,    /* DOS interrupt hijacked by JMP FAR or CALL FAR. */
  57.  
  58.   STEALTH_FILE_ERR      = 0x0001,    /* File not found or unable to open. */
  59.   STEALTH_FILE_DATE_ERR = 0x0002,    /* File date/time stamp invalid. */
  60.   STEALTH_FILE_SIZE_ERR = 0x0004,    /* File size inconsistent between directory and file open checks. */
  61.   STEALTH_CRC_BAD_POLY  = 0x0008,    /* CRC polynomial is invalid. */
  62.   STEALTH_NO_MEM        = 0x0010,    /* No memory to perform CRC check. */
  63.   STEALTH_CRC_INVALID   = 0x0020    /* CRC is invalid. */
  64.   };
  65.  
  66.  
  67. #if defined(__cplusplus)
  68. extern "C" {
  69. #endif
  70. void *bufalloc(size_t *size, size_t minsize);
  71. crc32_t calccrc(FILE *f, byte *buffer, size_t bufsize, crc32_t polynomial);
  72. unsigned stealth_sys_check(void);
  73. unsigned stealth_file_check(const char *filename, filecrc crc);
  74. #if defined(__cplusplus)
  75. }
  76. #endif
  77.